import service from "@/utils/request";

/**
 * 获取验证码
 * @param {*} data 
 * @returns 
 */
export function getCode(data) {
    return service.request({
        method: "post",
        url: "/getCode",
        data
    });
}

/**
 * 用户注册
 * @param {*} data 
 * @returns 
 */
export function register(data) {
    return service.request({
        method: "post",
        url: "/register",
        data
    });
}

/**
 * 用户登录
 * @param {*} data 
 * @returns 
 */
export function login(data) {
    return service.request({
        method: "post",
        url: "/login",
        data
    });
}

/**
 * 获取用户角色
 * @param {*} data 
 * @returns 
 */
export function getUserRole(data = {}) {
    return service.request({
        method: "post",
        url: "/userRole",
        data
    });
}